<template>
  <ul class="nav-bar">
      <li class="nav-item">
          <router-link to="/">
              <span class="icon"></span>
              <div class="text">首页</div>
          </router-link>
      </li>
      <li class="nav-item">
          <a :href="link" :class="thisRouter=='my'?'router-link-exact-active':''">
              <span class="icon"></span>
              <div class="text">我的</div>
          </a>
      </li>
  </ul>
</template>

<script>
export default {
  name: "navBar",
  data(){
      return {
          link: window.location.origin+'/login.htm?link='+encodeURIComponent(window.location.origin+'/html/index.html'+window.location.search+'#/my')
      }
  },
  props:{thisRouter:String},
  mounted() {
      console.log(this.link)
      console.log(this);
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.nav-bar{
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 1.26rem;
    overflow: hidden;
    background: #fff;
}
.nav-bar .nav-item{
    width: 50%;
    height: 100%;
    float: left;
    padding-top: .15rem;
    text-align: center;
}
.nav-bar .nav-item a{
    display: inline-block;
    width: 100%;
    height: 100%;
}
.nav-bar .nav-item .icon{
    display: inline-block;
    width: .42rem;
    height: .62rem;
    margin-bottom: .05rem;
}
.nav-bar .nav-item .text{
    font-size: .24rem;
    color: #8e8e8e;
    line-height: 1;
}
.nav-bar .nav-item .router-link-exact-active .text{
    color: #9a4ef9;
}
.nav-bar .nav-item:nth-child(1) .router-link-exact-active .icon{
    background: url('https://i.yile.vip/d/Y78h77i4113766414931_qUCTDq.png') 0 0 no-repeat;
    background-size: 100% 100%;
}
.nav-bar .nav-item:nth-child(1) .icon{
    background: url('https://i.yile.vip/a/Y78h78ck4j3073226356_zmfroN.png') 0 0 no-repeat;
    background-size: 100% 100%;
}
.nav-bar .nav-item:nth-child(2) .router-link-exact-active .icon{
    background: url('https://i.yile.vip/d/Y78h78edpf1348020783_bVHRxC.png') 0 0 no-repeat;
    background-size: 100% 100%;
}
.nav-bar .nav-item:nth-child(2) .icon{
    background: url('https://i.yile.vip/b/Y78h783jk62547369908_NlMnxR.png') 0 0 no-repeat;
    width: .62rem;
    background-size: 100% 100%;
}
</style>
